<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
   <div th:replace="~{common::css}"></div>
    <title>首页</title>
</head>
<body class="m-body">
<!--导航-->
<div th:replace="~{common::topbar(n=1)}"></div>
<!--中间内容-->
<div class="m-padded-tb-big m-container">
    <div class="ui container">
        <div class="ui stackable grid">
            <!--左边博客列表-->

           <div class="eleven wide column">
               <!--header-->
               <div class="ui top attached segment">
                   <div class="ui middle aligned two column grid">
                       <div class="column">
                           <h2 class="ui  teal header" id="top">博客</h2>
                       </div>
                       <div class=" right aligned column">
                           共&nbsp;&nbsp;&nbsp;&nbsp;<h2 class="ui orange header m-inline-block " th:text="${page.getTotal()}"></h2>&nbsp;&nbsp;&nbsp;&nbsp;篇
                       </div>
                   </div>
               </div>
               <!--博客内容-->
               <div id="table-container">
               <div class="ui  teal    segment" th:each="blog :${page.getList()}"  th:object="${blog}" style="background: url(/images/bg.jpg)">
                   <div class="ui  padded  vertical segment m-padded-tb-large" >
                       <div class="ui  mobile reversed stackable grid" >
                           <div class="eleven wide column" >
                               <!--文章内容-->
                               <h3 class="ui header " th:text="${blog.getTitle()}"></h3>
                               <!--描述-->
                               <p class="m-text-thin m-text-spaced m-text-lined" th:text="${blog.getDescription()}" style="font-size: 14px;font-weight: lighter !important;"></p>
                               <div class="ui grid">
                                   <div class="eleven wider column">
                                       <div class="ui horizontal link list mini">
                                           <!--博客信息-->
                                           <div class="item">
                                               <!--头像-->
                                               <img src="../static/images/varter.jpg" th:src="@{${blog.getAvatar()}}"  alt="" class="ui avatar image">
                                               <!--名字-->
                                               <div class="content"><a th:href="@{/toAbout}" class="header" th:text="${blog.getAuthor()}"></a></div>
                                           </div>
                                           <!--更新时间-->
                                           <!-- 时间格式化
                                           <span th:text="${#dates.format(user.date, 'yyyy-MM-dd')}"></span>     -->
                                           <div class="item">
                                               <i class="calendar alternate outline icon"></i>   <a href="#" th:text="${#dates.format(blog.getCreateTime(),'yyyy-MM-dd')}">  </a>
                                           </div>
                                           <!--浏览次数-->
                                           <div class="item">
                                               <a href="#" ><i class="eye  icon" ></i>&nbsp;&nbsp;<span th:text="${blog.getViews()}"></span> </a>
                                           </div>
                                       </div>
                                   </div>
                                   <!--标签名字-->
                                   <div class=" right aligned five wider column">
                                       <a href="" target="_blank" class="ui teal basic label m-padded-tb-tiny m-text-thin" th:text="${blog.getFlag()}"></a>
                                   </div>
                               </div>
                           </div>
                           <!--图片-->
                           <div class="five wide column">
                               <a th:href="@{/toBlog/{id}(id=${blog.getId()})}" target="_blank">
                                   <img src="../static/images/blog.jpg" th:src="@{${blog.getFirstPicture()}}" alt="" class="ui rounded image">
                               </a>
                           </div>
                       </div>
                   </div>


               </div>

               <!--footer-->
               <div class="ui bottom attached segment">
                   <div class="ui middle aligned two column grid" >
                       <div class="column" th:if="${page.hasPreviousPage}">
                           <a th:href="@{/toIndex(pageNum=${page.getPageNum()-1})}" class="ui  mini teal basic button" >上一页</a>

                       </div>

                       <div class=" right aligned column" th:if="${page.hasNextPage}">
                           <a th:href="@{/toIndex(pageNum=${page.getPageNum()+1})}" class="ui  mini teal basic button">下一页</a>
                       </div>
                   </div>
               </div>
               </div>
           </div>
            <!--右边的分类、标签列表-->
            <div class="five wide column">
                <!--分类列表-->
                <div class="ui segments">
                    <div class="ui secondary segment">
                        <div class="ui two column grid">
                            <div class="column">
                                <i class="idea icon"></i>分类
                            </div>
                            <div class=" right aligned column">
                                <a th:href="@{/toTypes/{id}(id=1)}" > more <i class="angle double right icon"></i></a>
                            </div>
                        </div>
                    </div>

                    <div class="ui teal segment">
                        <div class="ui  fluid vertical menu" th:each="type:${typeList.getList()}">
                            <a th:href="@{/toTypes/{id}(id=${type.getId()})}" class="item" > <span th:text="${type.getName()}"></span><div class=" ui  teal basic left pointing  label" th:text="${type.getCount()}">13</div></a>

                        </div>
                    </div>

                </div>
                <!--标签列表-->
                <div class="ui segments m-margin-top-large">
                    <div class="ui secondary segment">
                        <div class="ui two column grid">
                            <div class="column">
                                <i class="tags icon"></i>标签
                            </div>
                            <div class=" right aligned column">
                                <a th:href="@{/toTags/{id}(id=1)}"  >more <i class="angle double right icon"></i></a>
                            </div>
                        </div>
                    </div>
                    <div class="ui teal segment" >

                        <a   th:each="tag:${tagList.getList()}" th:href="@{/toTags/{id}(id=${tag.getId()})}" target="_blank" class="ui teal basic left pointing label m-margin-tb-tiny"   >
                            <span th:text="${tag.getName()}"></span>
                            <div class="detail" th:text="${tag.getCount()}">23</div> </a>


                    </div>
                </div>
                <!--最新推荐-->
                <div class="ui segments m-margin-top-large">
                    <div class="ui secondary segment">
                        <i class="bookmark icon"></i>最新推荐
                    </div>
                         <div class="ui segment" th:each="blog : ${blogList}">
                             <a th:href="@{/search(quarry=${blog.getTitle()})}" target="_blank" class="m-black" th:text="${blog.getTitle()}">用户故事</a>
                         </div>

                </div>
                <!--二维码-->
                <h4 class="ui horizontal divider header m-margin-top-large ">赞 赏</h4>
                <div class="ui  centered card " style="width: 13em">
                    <img src="../static/images/Iplay.png" th:src="@{/images/Iplay.png}" alt="" class="ui round image" >
                </div>
                <h4 class="ui horizontal divider header m-margin-top-large ">Music</h4>
                <div class="ui  centered card " style="width: 13em">
            <!--        <audio th:src="@{images/music.mp3}" controls  autoplay class="ui  mini teal    button "  ></audio>-->
                </div>

            </div>
           </div>
        </div>

    <link rel="icon" th:href="@{/static/favicon.ico}">

</div>
<!--底部 footer-->
<div th:replace="~{common::footer}"></div>
<script src="../static/js/jquery-3.5.1.js" th:src="@{/js/jquery-3.5.1.js}"></script>
<script src="https://cdn.jsdelivr.net/npm/semantic-ui@2.4.2/dist/semantic.min.js"></script>
    <script>
        $('.menu.toggle').click(function (){
            $('.m-item').toggleClass('m-mobile-hide');

        });
        $('.ui.dropdown').dropdown({
            on : 'hover',
        });
    </script>
</body>

</html>